var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
const apiRouter = require('./routes/api/index');
const videoRouter = require('./routes/video');
const excelRouter = require('./routes/excel');

var app = express();

app.use('/public', express.static(path.join(__dirname, 'public')));
app.engine('html', require('express-art-template'));
app.set('views', path.join(__dirname, 'view'));
app.set('view engine', 'html');

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());

app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/', apiRouter);
app.use('/', videoRouter);
app.use('/', excelRouter);

module.exports = app;
